<!-- 页面头部组件 - 包含返回按钮和页面标题 -->
<div class="header-container">
  <!-- 返回按钮 -->
  <button class="back-btn" onclick="history.back()">
    <i class="fas fa-chevron-left"></i>
  </button>
  
  <!-- 页面标题 -->
  <div class="page-title">
    <h1 id="title-text">页面标题</h1>
  </div>
  
  <!-- 右侧占位，保持标题居中 -->
  <div class="header-right"></div>
</div>

<style>
.header-container {
  position: fixed;
  top: 44px;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #264653;
  flex-shrink: 0;
}

.back-btn:hover {
  background: rgba(38, 70, 83, 0.1);
  transform: scale(1.05);
}

.back-btn:active {
  transform: scale(0.95);
  background: rgba(38, 70, 83, 0.2);
}

.back-btn i {
  font-size: 18px;
  font-weight: 600;
}

.page-title {
  flex: 1;
  text-align: center;
  margin: 0 16px;
}

#title-text {
  font-size: 18px;
  font-weight: 600;
  color: #264653;
  margin: 0;
  line-height: 1.2;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-right {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
</style>

<script>
// 动态设置页面标题
function setPageTitle(title) {
  const titleElement = document.getElementById('title-text');
  if (titleElement) {
    titleElement.textContent = title;
  }
}

// 导出设置标题的函数供外部调用
window.setPageTitle = setPageTitle;
</script>
